import Vue from 'vue'
import App from './App'

import store from './store/index';
Vue.prototype.$store = store;
Vue.prototype.baseURL = 'http://localhost:8080';
Vue.prototype.checkLogin = function() {
	const token = uni.getStorageSync('userId')
	console.log('token==========', token);
	if (token === '') { // 本地没有token表示未登录
		uni.showModal({
			title: '登录拦截',
			content: "系统监测到您尚未登录!",
			confirmText: '前往登录',
			confirmColor: '#3CC51F',
			success: function(msg) {
				if (msg.confirm) {
					console.log(msg)
					uni.reLaunch({
						url: '/pages/user/center/center'
					})
				} else if (msg.cancel) {

				}
			}
		});
		return false
	} else {
		return true;
	}
}
import './style.css'
//配置
import config from './config.js'
Vue.prototype.$conf = config

Vue.prototype.$msg = (title, duration = 1500, mask = false, icon = 'none') => {
	//统一提示方便全局修改
	if (Boolean(title) === false) {
		return;
	}
	uni.showToast({
		title,
		duration,
		mask,
		icon
	});
}

import api from './common/vmeitime-http/index.js'
Vue.prototype.$api = api

import appupgrade from './common/appupgrade.js'
Vue.prototype.$appUpgrade = appupgrade

Vue.config.productionTip = false

App.mpType = 'app'

const app = new Vue({
	...App
})
app.$mount()
